package businesslogic.MessageBl;

import appendix.ResultMessage;
import po.MessagePO;
import ClientHelper.ClientHelper;
import dataservice.MessageDataService;

public class Message {
	MessageDataService service;
	
	public Message(){
		service=ClientHelper.getMessageData();
	}
	
	public void addMessage(MessagePO po){
		try{
			service.insert(po);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public ResultMessage<?> getMessage(long id){
		ResultMessage<?> rm=null;
		try{
			rm=service.finds(id);
		}catch(Exception e){
			e.printStackTrace();
		}
		return rm;
	}
	
	public void deleteMessage(long id){
		try{
			service.delete(id);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
